﻿<%@ Control language="C#" Inherits="Triax.Modules.Passport.EditPassport" CodeFile="EditPassport.ascx.cs" AutoEventWireup="true"%>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<script type="text/javascript">
function NamSinh_OnChange(input){
    if (input.value.length<=2){
        input.value = '19' + input.value;
    }
}
String.prototype.toTitleCase = function () {
	var A = this.split(' '), B = [];
	for (var i = 0; A[i] !== undefined; i++) {
		B[B.length] = A[i].substr(0, 1).toUpperCase() + A[i].substr(1);
	}
	return B.join(' ');
}
function HoTen_OnChange(input){
    input.value = input.value.toTitleCase();
}


//$('input.enterastab, select.enterastab, textarea.enterastab').live('keydown', function(e) {
// if (e.keyCode==13) {
//  var focusable = $('input,a,select,button,textarea').filter(':visible');
//  focusable.eq(focusable.index(this)+1).focus();
//  return false;
// }
//});
//$('input.enterastab, select.enterastab, textarea.enterastab').live('keypress', function(e) {
// if (e.keyCode==13) {
//  var focusable = $('input,a,select,button,textarea').filter(':visible');
//  focusable.eq(focusable.index(this)+1).focus();
//  return false;
// }
//});

function changeEnterKeyToTabKey(event, name){
    if(event.keyCode==13){
        $('[id*="' + name + '"]').focus();
        return false;
    }
    return event;
}
$(document).ready(function() {
      $('[id*="txtSoCMND"]').focus();
});

</script>
<table width="650" cellspacing="0" cellpadding="0" border="0" summary="Edit Table">
	<tr valign="top">
	    <td rowspan="10">
	        <asp:Image ID="anhCMND" runat=server Height="350"/>
	        <asp:HiddenField ID="inputFileName" runat="server" />
	        <asp:HiddenField ID="inputFileName1" runat="server" />
	    </td>
		<td class="SubHead" width="125"><dnn:label id="lblTinh" runat="server" controlname="lblTinh3" suffix=":"></dnn:label></td>
		<td>
			<asp:TextBox id="txtTinh"  o runat="server" Width="200" 
                Enabled="false" onkeydown="return changeEnterKeyToTabKey(event, 'txtSoCMND');" />
			<asp:RequiredFieldValidator ID="valTinh" resourcekey="valTinh.ErrorMessage" ControlToValidate="txtTinh"
				CssClass="NormalRed" Display="Dynamic" ErrorMessage="<br>Tinh is required" Runat="server" />
		</td>
	</tr>
	<tr valign="top">

		<td class="SubHead" width="125"><dnn:label id="lblSoCMND" runat="server" controlname="lblSoCMND" suffix=":"></dnn:label></td>
		<td>
			<asp:TextBox id="txtSoCMND"  runat="server" Width="200" onkeydown="return changeEnterKeyToTabKey(event, 'txtHoTen');"/>
			<asp:RequiredFieldValidator ID="valSoCMND" resourcekey="valSoCMND.ErrorMessage" ControlToValidate="txtSoCMND"
				CssClass="NormalRed" Display="Dynamic" ErrorMessage="<br>SoCMND is required" Runat="server" />
		</td>
	</tr>
	
	<tr valign="top">
		<td class="SubHead" width="125"><dnn:label id="lblHoTen" runat="server" controlname="lblHoTen" suffix=":"></dnn:label></td>
		<td>
			<asp:TextBox id="txtHoTen"  runat="server"  Width="200" onchange="HoTen_OnChange(this);" 
			onkeydown="changeEnterKeyToTabKey(event, 'lstGioiTinh');"/>
			<asp:RequiredFieldValidator ID="valHoTen" resourcekey="valHoTen.ErrorMessage" ControlToValidate="txtHoTen"
				CssClass="NormalRed" Display="Dynamic" ErrorMessage="<br>HoTen is required" Runat="server" />
		</td>
	</tr>
	<tr valign="top">
		<td colspan="4">
		<table width="200">
		<tr>
            <td class="SubHead" width="70"  >
                <dnn:Label ID="lblGioiTinh" runat="server" ControlName="lblGioiTinh" Suffix=":">
                </dnn:Label></td>
		<td>
                <asp:DropDownList ID="lstGioiTinh"  runat="server" onkeydown="changeEnterKeyToTabKey(event, 'txtNamSinh');" >
                    <asp:ListItem>Nam</asp:ListItem>
                    <asp:ListItem>Nữ</asp:ListItem>
                </asp:DropDownList>
                
            </td>
            <td class="SubHead" >
                <dnn:Label ID="lblNamSinh" width="70" runat="server" ControlName="lblNamSinh" Suffix=":"></dnn:Label></td>
		<td>
                <asp:TextBox ID="txtNamSinh"  runat="server" Width="100"
                    onchange="NamSinh_OnChange(this);" onkeydown="changeEnterKeyToTabKey(event, 'cmdUpdate');" />
                <asp:RequiredFieldValidator ID="valNamSinh" resourcekey="valNamSinh.ErrorMessage"
                    ControlToValidate="txtNamSinh" CssClass="NormalRed" Display="Dynamic" ErrorMessage="<br>NamSinh is required"
                    runat="server" />
            </td>
        </tr>
		</table>

	</tr>
    <tr><td colspan="4" style="text-align: center;"><p>
    <asp:linkbutton cssclass="CommandButton" id="cmdUpdate" OnClick="cmdUpdate_Click" 
            resourcekey="cmdUpdate" runat="server" borderstyle="none" text="Update" 
            AccessKey="u" ></asp:linkbutton>&nbsp;
    <asp:linkbutton cssclass="CommandButton" id="cmdCancel" OnClick="cmdCancel_Click" 
            resourcekey="cmdCancel" runat="server" borderstyle="none" text="Cancel" 
            causesvalidation="False" AccessKey="c"></asp:linkbutton>&nbsp;
    <asp:linkbutton cssclass="CommandButton" id="cmdDelete" OnClick="cmdDelete_Click" resourcekey="cmdDelete" runat="server" borderstyle="none" text="Delete" causesvalidation="False"></asp:linkbutton>&nbsp;
</p></td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr>
</table>

<dnn:audit id="ctlAudit" runat="server" />
